package com.example.qxfw.qxzs.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.qxfw.common.entity.zy.TourSmallscale;
import com.example.qxfw.qxzs.mapper.TourSmallScaleMapper;
import com.example.qxfw.qxzs.service.TourSmallScaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

@Service
public class TourSmallScaleServiceImpl implements TourSmallScaleService {

    @Autowired
    private TourSmallScaleMapper tourSmallScaleMapper;

    @Override
    public List<TourSmallscale> listByParam(String observTime1, String observTime2, String stationId) {
        return tourSmallScaleMapper.selectList(Wrappers.<TourSmallscale>lambdaQuery()
                .between(TourSmallscale::getObservtime, Timestamp.valueOf(observTime1),Timestamp.valueOf(observTime2))
                .eq(TourSmallscale::getStationid,stationId)
                .orderByAsc(TourSmallscale::getStationid,TourSmallscale::getObservtime));
    }
}
